﻿<UserControl x:Class="Notoric.View.Music.CWNotation.Controls.Clef"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:me="clr-namespace:Notoric.View.Music.CWNotation.Controls" 
             xmlns:vme="clr-namespace:Notoric.ViewModel.Elements;assembly=ViewModel"
             DataContextChanged="UserControl_DataContextChanged"
             Loaded="UserControl_Loaded"
             PreviewMouseLeftButtonDown="UserControl_PreviewMouseLeftButtonDown">
    <Canvas>
        <me:CoreSymbolDragThumb x:Name="PART_ClefSymbol" Text="&amp;" Canvas.Left="{Binding Position, Mode=OneWay}" Canvas.Top="{Binding Path=VerticalPosition, Mode=OneWay}"
                                FontFamily="MusicalSymbols" FontSize="{Binding EffectiveTypeSize, Mode=OneWay}" Margin="0 -0.125 0 0" Cursor="Hand">
            <me:CoreSymbolDragThumb.Template>
                <ControlTemplate TargetType="{x:Type me:CoreSymbolDragThumb}">
                    <TextBlock x:Name="PART_Symbol" Text="{TemplateBinding Text}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_Symbol" Property="Foreground" Value="Blue"/>
                        </Trigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsSelected, Mode=OneWay}" Value="True"/>
                                <Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=FixedPage, AncestorLevel=1}}" Value="{x:Null}"/>
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="PART_Symbol" Property="Foreground" Value="Blue"/>
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </me:CoreSymbolDragThumb.Template>
            <me:CoreSymbolDragThumb.ContextMenu>
                <ContextMenu>
                    <MenuItem x:Name="menu_TrebleClef" Header="Treble Clef" Click="menu_CombinedClefType_Click"/>
                    <MenuItem x:Name="menu_BassClef" Header="Bass Clef" Click="menu_CombinedClefType_Click"/>
                    <MenuItem x:Name="menu_TenorClef" Header="Tenor Clef" Click="menu_CombinedClefType_Click"/>
                    <MenuItem x:Name="menu_AltoClef" Header="Alto Clef" Click="menu_CombinedClefType_Click"/>
                    <Separator/>
                    <MenuItem x:Name="menu_GClef" Header="G Clef" Click="menu_ClefType_Click"/>
                    <MenuItem x:Name="menu_FClef" Header="F Clef" Click="menu_ClefType_Click"/>
                    <MenuItem x:Name="menu_CClef" Header="C Clef" Click="menu_ClefType_Click"/>
                </ContextMenu>
            </me:CoreSymbolDragThumb.ContextMenu>
        </me:CoreSymbolDragThumb>
    </Canvas>
</UserControl>
